home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
cli
/
DiskLED1.2.lha
/
SysInit.i
< prev
next >
Wrap
Text File
|
2000-09-05
|
2KB
|
73 lines
Section Init,Code_P
Init_Setup
Movem.l d0/a0,-(sp) ;This section is relased if program was
Clr.l ReturnMsg ;started from shell...
Sub.l a1,a1
CALLEXEC FindTask
Move.l d0,a4 ; A4=Task
Tst.l Pr_CLI(a4)
Beq.b .WBStartUp
Movem.l (Sp)+,d0/a0
Tst.l Pr_TaskNum(a4) ; Check If No-Cli or WB
Bne.b .Clistartup
Move.w #1,Nodosorwb
Bra.b .StartUpEnd
.Clistartup
Lea.l Dos_Name,a1
CALLEXEC OldOpenLibrary ;Open dos.library
Tst.l d0
Beq.l .StartUpErr ;Error! Exit!
Move.l d0,a6
Jsr _LVOOutput(a6) ;Set standard output
Move.l d0,_StdOut
Jsr _LVOInput(a6) ;Set standard input
Move.l d0,_StdIn
Lea.l Init_Setup(Pc),a0 ; Fetch Segment List first Routine
Move.l -(a0),d3 ; Fetch next segment (Main: and forward)
Clr.l (a0) ; Cut first segment from list
Move.l #DiskLedName,d1 ; Procedure Name
Moveq.l #-10,d2 ; Prioritet
Move.l #5120,d4 ; Stack Size
Jsr _LVOCreateProc(a6) ; Startup process
Moveq.l #0,d0 ; Clean exit
Rts
.WBStartUp
Move.l a4,a1 ; Get Task
Lea.l Pr_MsgPort(a4),a0
CALLEXEC WaitPort
Lea.l Pr_MsgPort(a4),a0
CALLEXEC GetMsg
Move.l d0,ReturnMsg
Movem.l (Sp)+,d0/a0
.StartUpEnd
Jsr Start
Move.l d0,-(sp)
Cmp.w #1,Nodosorwb
Beq.b .Exittodos
Tst.l ReturnMsg
Beq.s .ExitToDOS
CALLEXEC Forbid
Move.l ReturnMsg,a1
CALLEXEC ReplyMsg
.ExitToDOS Move.l (Sp)+,d0 ;Program exit at WB start
Rts
.StartUpErr
Moveq.l #20,d0 ; Ooops... fail..
Rts
Even
Version Dc.b '$VER: '
DiskLedName Dc.b 'DiskLED V1.2',0
Even
*******************
_Stdout Dc.l 0
_Stdin Dc.l 0
Returnmsg Dc.l 0
Nodosorwb Dc.w 0
*******************************************************************************